package com.mammoth.Bodybuilding.service.Impl;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mammoth.Bodybuilding.entity.ResultObj;
import com.mammoth.Bodybuilding.respository.IRoleRepository;
import com.mammoth.Bodybuilding.service.IRoleService;

/**
 * 
 * 
 * @title : RoleServiceImpl.java
 * @description : 角色service实现层
 * @company : com.mammoth.Bodybuilding.service.Impl
 * @project Mammoth
 * @author xingzhaojun
 * @date 2018年5月4日下午4:45:51
 */
@Service
@Transactional
public class RoleServiceImpl implements IRoleService {

	/** 自动注入role数据仓库 **/
	@Autowired
	private IRoleRepository roleRepository;

	@Override
	public ResultObj getAllRole() {
		ResultObj resultObj = new ResultObj();
		resultObj.setCode(1);
		resultObj.setFlag(true);
		resultObj.setResult(roleRepository.findAll());
		resultObj.setMessage("查询成功");
		return resultObj;
	}

}
